package com.xposed.aliproxy.xposed;

import android.content.Context;
import android.content.Intent;

import com.xposed.aliproxy.utils.Utils;
import com.xposed.aliproxy.utils.XposeUtil;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XC_MethodHook.MethodHookParam;

public class AliHookMethodf extends XC_MethodHook {
    private ClassLoader classLoader;
    private Context context;

    public AliHookMethodf(Context context, ClassLoader classLoader) {
        this.context = context;
        this.classLoader = classLoader;
    }

    @Override
    protected void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
        String a = XposeUtil.xposedAliSocialSdkContactService(this.classLoader);
        XposeUtil.xposedLog("loginId->", a);
        if (!Utils.isNull(a)) {
            Intent intent = new Intent("com.abcd.xpouseali.action.aliloginid");
            intent.putExtra("local_realaliid", a);
            this.context.sendBroadcast(intent);
        }
    }
}
